package com.example.administrator.view;

import android.content.Context;
import android.webkit.JavascriptInterface;
import android.widget.Toast;

public class JsToAndroid {
    private Context context;

    //通过构造函数获取上下文
    public JsToAndroid(Context context){
        this.context = context;
    }

    @JavascriptInterface
    public void hello(String str){
        Toast.makeText(context, "hello "+ str,
                Toast.LENGTH_SHORT).show();
    }
}
